//
//  ZFAlertManager.h
//  components
//
//  Created by linzaifei on 2021/7/12.
//

#import <UIKit/UIKit.h>
@class ZFAlertAction;
NS_ASSUME_NONNULL_BEGIN

typedef void (^ActionBlock)(ZFAlertAction *action) ;
typedef void (^TextFiedBlock)(UITextField *textfied) ;
@interface ZFAlertManager : UIAlertController

-(instancetype)init NS_UNAVAILABLE;

///手动添加一个action (需要自己配置action)
-(ZFAlertManager* (^)(ZFAlertAction *action))addCustomAction;

///添加一个defaultAction title
-(ZFAlertManager*(^)(NSString *title))addDefaultTitle;
///添加一个cancelAction title
-(ZFAlertManager*(^)(NSString *title))addCencalTitle;
///添加一个DestructiveAction title
-(ZFAlertManager*(^)(NSString *title))addDestructiveTitle;
///添加一个textField
-(ZFAlertManager*(^)(TextFiedBlock block))addTextField;

///点击action回调
-(ZFAlertManager*)onDidClickAction:(ActionBlock)block;

///alert 视图
-(ZFAlertManager*)showAlertInController:(UIViewController *)control animated:(BOOL)animated;

@end

NS_ASSUME_NONNULL_END

@interface ZFAlertAction : UIAlertAction
+(instancetype _Nonnull )actionWithTitle:( NSString *_Nonnull)title style:(UIAlertActionStyle)style block:(ActionBlock _Nullable )block;
///按钮title字体颜色
@property(nonatomic,strong)UIColor * _Nonnull textColor;


@end
